%%%%%%%%%%%%%%%%%%%
% learn_dur_probs.m
%%%%%%%%%%%%%%%%%%%

save nick durs dmin dmax;

% durs comes in as 1 x N matrix
% so transpose to get as N x 1
durs = durs';

% Fit Gamma to durs and extract model parameters
phat = gamfit(durs);
a = phat(1);
b = phat(2);

% Compute dur probs under model for durs from dmin to dmax
dur_probs = gampdf([dmin:dmax]', a, b);

% Finally normalise the values returned
dur_probs = dur_probs/sum(dur_probs);
